//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================
//#include <elastos.h>
#include <stdio.h>
#include <aura.h>

typedef Aura_Bool (*test_func_ptr)();

struct test_case
{
    char * test_name;
    test_func_ptr test_func;
};

Aura_Bool AuraTest_Join();
Aura_Bool AuraTest_Join_After_thread_Death();
Aura_Bool AuraTest_Event();
Aura_Bool AuraTest_ThreadSuspendAndResume();
Aura_Bool AuraTest_MutexTimeOut();

struct test_case test_case[] =
{
//    {"AuraTest_Join                   ", AuraTest_Join                   },
//    {"AuraTest_Join_After_thread_Death", AuraTest_Join_After_thread_Death},
//    {"AuraTest_Event                  ", AuraTest_Event                  },
    {"AuraTest_ThreadSuspendAndResume", AuraTest_ThreadSuspendAndResume},
    {"AuraTest_MutexTimeOut      ", AuraTest_MutexTimeOut                  },
    {AURA_NULL                              , AURA_NULL                            }
};

int  test_initialize()
{
    return 0;
}

void test_destroy()
{
    return ;
}

int main(void)
{
    int res = 0;

    res = test_initialize();
    if (res < 0) {
        printf(" <test> failed to initialize.\n");
        return -1;
    }
    printf(" <THREAD> test starting ......\n");
    for (int i = 0; test_case[i].test_func != NULL; i++) {
        if (test_case[i].test_func()) {
            printf(" <<<%s>>> ----PASSED ----!\n",test_case[i].test_name);
        }
        else {
            printf("!<<<%s>>> ----AURA_FAILED ----!\n",test_case[i].test_name);
            return -1;
        }
    }
    printf(" <THREAD> test ended .........\n\n\n");
    test_destroy();
    return 0;
}



